import request from '@/request/request'

// 获取会员列表
export function getMemberList() {
    return request({
        method: "get",
        url: "/retail/members",
    })
}

// 分页查询零售出库单
export function getRetailOutboundPage(params) {
    return request({
        method: "get",
        url: "/retail/outbound/page",
        params
    })
}

// 创建零售出库单
export function createRetailOutbound(data) {
    return request({
        method: "post",
        url: "/retail/outbound",
        data
    })
}

// 更新零售出库单
export function updateRetailOutbound(data) {
    return request({
        method: "put",
        url: "/retail/outbound",
        data
    })
}

// 删除零售出库单
export function deleteRetailOutbound(id) {
    return request({
        method: "delete",
        url: `/retail/outbound/${id}`,
    })
}

// 完成零售出库单
export function completeRetailOutbound(id) {
    return request({
        method: "put",
        url: `/retail/outbound/complete/${id}`,
    })
}

// 获取零售出库单详情（包含明细）
export function getRetailOutboundWithDetails(id) {
    return request({
        method: "get",
        url: `/retail/outbound/withDetails/${id}`,
    })
}
